package com.app.demo33.controller;

import com.app.demo33.entity.Student;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Controller
public class HomeController {
    //日志记录工具
    Logger logger= LoggerFactory.getLogger(HomeController.class);
    @Autowired
    Student stu;
    @RequestMapping("/index")
    public String index(Model model){
        model.addAttribute("info","大家好");
        model.addAttribute("stu",stu);
        logger.info("logger info index页面");
        logger.warn("logger warn index页面");
        logger.debug("logger debug index页面");
        logger.error("logger error index页面");
        return "index";
    }
}
